home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 32 / CD Expert nº 32.iso / Emergency / emergyus.exe / BC5 / EXAMPLES / DLLMIX / readme.txt
Text File  |  1997-03-25  |  3KB  |  63 lines

  1. Calling 32-bit DLL's built with Borland C++ from non-BC Apps
  2. ============================================================
  3. Currently, Borland C++ supports calling a DLL compiled with Borland C++ from
  4. applications created with other tools only if they are dynamically bound to the
  5. DLL. This is achieved by the application calling LoadLibrary at run-time to load
  6. the DLL and then calling GetProcAddress to retrieve the entry points for the
  7. functions exported from the DLL.
  8.  
  9. Static binding is not supported. From a C or C++ application, static binding is
  10. achieved by linking import records (either import libraries or entries in the
  11. IMPORTS section of the application's Module Definition File) to the calling
  12. application. Using Delphi 2.0, static binding is achieved using a declaration
  13. such as:
  14.  
  15. function Foo(parm: Integer): Integer; stdcall; external 'my.dll' name 'Foo';
  16.  
  17. You can use either C++ or Structured Exception Handling in the DLL. For best
  18. results, exceptions should be caught within the scope of the DLL throwing the
  19. exception. If the calling application is built with Borland C++, Delphi or
  20. Microsoft Visual C++, the exception can be caught in the application calling the
  21. DLL; however, Visual Basic does not seem to have an exception handlng syntax.
  22.  
  23. To create an EH-compatible 32-bit DLL, just replace the default startup code,
  24. c0d32.obj for 32-bit DLL's, with c0d32dyn.obj and re-link the DLL. Using
  25. command-line tools, the startup code is the first object module specified to
  26. Tlink32. Using the Integrated Development Environment, select Options |
  27. Environment | Project View and check Show run-time nodes. In the project window,
  28. there will now be displayed entries for the startup module and all the libraries
  29. which are automatically linked in depending on your target. Remove the node for
  30. the startup code, c0d32.obj, and add c0d32dyn.obj in its place.
  31.  
  32. List of files
  33. =============
  34. README.TXT     - This file
  35. C0D32DYN.OBJ   - Startup for building compatible DLL's
  36.  
  37. BCDLL.CPP      - Source and built DLL to be called
  38. BCDLL.H        - Header file for the DLL and C/C++ consumers
  39. BCDLL.DEF      - Module definition file
  40. BCDLL.DLL      - Built version of the DLL
  41. MAKEDLL.MAKE   - Makefile for building the test DLL
  42.  
  43. CTOBC.CPP      - C++ source for a test application calling BCDLL
  44. CTOBC.RC       - Dialog resource
  45. CTOBC.RH       - Resource header file
  46. HANDSHAK.BMP   - Main window bitmap
  47. HANDSHAK.ICO   - Application icon
  48.  
  49. MAKEBC.MAK     - Makefile for building CToBC with Borland C++
  50. BCTOBC.EXE     - CToBC built with Borland C++
  51. MAKEVC.MAK     - Makefile for building CToBC with Microsoft Visual C++
  52. VCTOBC.EXE     - CToBC buiilt with Microsoft Visual C++
  53.  
  54. DELPHI2C.DPR   - Delphi 2.0 project for a test application calling BCDLL
  55. DELPHI2C.EXE   - Built version of Delphi2C test application
  56. MAIN.DFM       - Form resource
  57. MAIN.PAS       - Pascal source for Delphi2C application
  58.  
  59. VBTOC.EXE      - Visual Basic 4.0 project for a test application calling BCDLL
  60. VBTOC.FRM      - Form resource
  61. VBTOC.MAK      - Project file
  62. VB40032.DLL    - Visual Basic run-time library
  63.